//
//  YZNetworkManager+Trade.h
//  YZMicroStock
//
//  Created by wangminhong on 16/4/13.
//  Copyright © 2016年 cqjr. All rights reserved.
//

#import "YZNetworkManager.h"
#import "YZMTradeTypeDef.h"

@interface YZNetworkManager (Trade)

/**
 *  获取股票购买配置参数（跟用户相关）
 *
 *  @param success
 *  @param failure
 */
- (void)td_getConfigureDataSuccess:(void (^)(NSURLResponse *response,id responseObject))success failure: (void (^)(NSError *error))failure;

/**
 *  获取股票购买配置参数（跟用户相关）盈利宝
 *
 *  @param success
 *  @param failure
 */
- (void)td_getYLBConfigureDataSuccess:(void (^)(NSURLResponse *response,id responseObject))success failure: (void (^)(NSError *error))failure;

/**
 *  获取限制股
 *
 *  @param success
 *  @param failure 
 */
- (void)td_getLimitStockListSuccess:(void (^)(NSURLResponse *response,id responseObject))success failure: (void (^)(NSError *error))failure;

/**
 *  点买交易发起
 *
 *  @param stockCode     股票名称
 *  @param money         点买金额
 *  @param lever         模式
 *  @param quitGain      止盈金额
 *  @param quitLoss      止损金额
 *  @param principal     保证金
 *  @param serviceCharge 服务费
 *  @param stockCount    点买数量
 *  @param token
 *  @param success
 *  @param failure       
 */
//- (void)td_submitTradeWithStockCode:(NSString *)stockCode andMoney:(double)money andLever:(NSInteger)lever andQuitGain:(double)quitGain andQuitLoss:(double)quitLoss andPrincipal:(double)principal andServiceCharge:(double)serviceCharge andStockCount:(NSInteger)stockCount andToken:(NSString *)token success:(void (^)(NSURLResponse *response,id responseObject))success failure: (void (^)(NSError *error))failure;
- (void)td_submitTradeWithStockCode:(NSString *)stockCode andMoney:(NSString *)money andLever:(NSInteger)lever andQuitGain:(NSString *)quitGain andQuitLoss:(NSString *)quitLoss andPrincipal:(NSString *)principal andServiceCharge:(NSString *)serviceCharge andStockCount:(NSInteger)stockCount andToken:(NSString *)token andUseRedpack:(BOOL )useRedpack success:(void (^)(NSURLResponse *response,id responseObject))success failure: (void (^)(NSError *error))failure;

/**
 *  点买交易发起 ylb
 *
 *  @param stockCode     股票名称
 *  @param money         点买金额
 *  @param lever         模式
 *  @param quitGain      止盈金额
 *  @param quitLoss      止损金额
 *  @param principal     保证金
 *  @param serviceCharge 服务费
 *  @param stockCount    点买数量
 *  @param token
 *  @param success
 *  @param failure
 */
- (void)td_submitTradeYLBWithStockCode:(NSString *)stockCode andMoney:(NSString *)money andLever:(NSInteger)lever andQuitGain:(NSString *)quitGain andQuitLoss:(NSString *)quitLoss andPrincipal:(NSString *)principal andServiceCharge:(NSString *)serviceCharge andStockCount:(NSInteger)stockCount andToken:(NSString *)token andUseRedpack:(BOOL)useRedpack success:(void (^)(NSURLResponse *, id))success failure:(void (^)(NSError *))failure;

/**
 *  获取点卖列表
 *
 *  @param page     页码
 *  @param pageSize 页码大小
 *  @param timeEnd  截止时间
 *  @param success
 *  @param failure  
 */
- (void)td_fetchSaleTradeListWithPage:(NSInteger)page andPageSize:(NSInteger)pageSize andTimeEnd:(NSString *)timeEnd success:(void (^)(NSURLResponse *response,id responseObject))success failure: (void (^)(NSError *error))failure;

- (void)td_fetchSaleTradeListOfMemcacheWithPage:(NSInteger)page andPageSize:(NSInteger)pageSize andTimeEnd:(NSString *)timeEnd success:(void (^)(NSURLResponse *response,id responseObject))success failure: (void (^)(NSError *error))failure;

/**
 *  获取点卖列表 盈利宝
 *
 *  @param page     页码
 *  @param pageSize 页码大小
 *  @param timeEnd  截止时间
 *  @param success
 *  @param failure
 */

- (void)td_fetchSaleTradeYLbListWithPage:(NSInteger)page andPageSize:(NSInteger)pageSize andTimeEnd:(NSString *)timeEnd success:(void (^)(NSURLResponse *response,id responseObject))success failure: (void (^)(NSError *error))failure;


- (void)td_fetchSaleTradeYlbListOfMemcacheWithPage:(NSInteger)page andPageSize:(NSInteger)pageSize andTimeEnd:(NSString *)timeEnd success:(void (^)(NSURLResponse *response,id responseObject))success failure: (void (^)(NSError *error))failure;


/**
 *  点卖交易
 *
 *  @param tid             交易ID
 *  @param alwaysCloseFlag 是否递延
 *  @param success
 *  @param failure
 */
- (void)td_closeTradeWithID:(long long)tid andAlwaysCloseFlag:(BOOL)alwaysCloseFlag success:(void (^)(NSURLResponse *response,id responseObject))success failure: (void (^)(NSError *error))failure;

/**
 *  点卖交易  盈利宝
 *
 *  @param tid             交易ID
 *  @param alwaysCloseFlag 是否递延
 *  @param success
 *  @param failure
 */
- (void)td_closeTradeYlbWithID:(long long)tid andAlwaysCloseFlag:(BOOL)alwaysCloseFlag success:(void (^)(NSURLResponse *response,id responseObject))success failure: (void (^)(NSError *error))failure;

/**
 *  获取结算列表
 *
 *  @param page     页码
 *  @param pageSize 页码大小
 *  @param timeEnd  截止时间
 *  @param success
 *  @param failure
 */
- (void)td_fetchTradeSettlementListWithPage:(NSInteger)page andPageSize:(NSInteger)pageSize andTimeEnd:(NSString *)timeEnd success:(void (^)(NSURLResponse *response,id responseObject))success failure: (void (^)(NSError *error))failure;

/**
 *  获取结算列表 盈利宝
 *
 *  @param page     页码
 *  @param pageSize 页码大小
 *  @param timeEnd  截止时间
 *  @param success
 *  @param failure
 */
- (void)td_fetchTradeYlbSettlementListWithPage:(NSInteger)page andPageSize:(NSInteger)pageSize andTimeEnd:(NSString *)timeEnd success:(void (^)(NSURLResponse *response,id responseObject))success failure: (void (^)(NSError *error))failure;

/**
 *  获取结算详情
 *
 *  @param tid     结算ID
 *  @param success
 *  @param failure 
 */
- (void)td_fetchTradeSettlementDetailWithID:(long long)tid success:(void (^)(NSURLResponse *response,id responseObject))success failure: (void (^)(NSError *error))failure;

/**
 *  获取结算详情 盈利宝
 *
 *  @param tid     结算ID
 *  @param success
 *  @param failure
 */

- (void)td_fetchTradeYlbSettlementDetailWithID:(long long)tid success:(void (^)(NSURLResponse *response,id responseObject))success failure: (void (^)(NSError *error))failure;
/**
 *  获取免费体验结算详情
 *
 *  @param tid     结算ID
 *  @param success
 *  @param failure
 */

- (void)td_fetchTradeFreeExSettlementDetailWithID:(long long)tid success:(void (^)(NSURLResponse *response,id responseObject))success failure: (void (^)(NSError *error))failure;

/**
 *  同意点买协议
 *
 *  @param success
 *  @param failure
 */
- (void)td_signTradeAgreementSuccess:(void (^)(NSURLResponse *response,id responseObject))success failure: (void (^)(NSError *error))failure;

/**
 *  获取单股累计金额
 *
 *  @param stockCode
 *  @param success
 *  @param failure   
 */
- (void)td_fetchStockAmonutStatisticsWithStockCode:(NSString *)stockCode success:(void(^)(NSURLResponse *response,id responseObject))success failure: (void (^)(NSError *error))failure;

/**
 *  获取单股累计金额 ylb
 *
 *  @param stockCode
 *  @param success
 *  @param failure
 */
- (void)td_fetchYLBStockAmonutStatisticsWithStockCode:(NSString *)stockCode success:(void (^)(NSURLResponse *response,id responseObject))success failure: (void (^)(NSError *error))failure;

@end
